/*
 * TagByte.cpp
 *
 *  Created on: 18 juin 2011
 *      Author: Pierrick Caillon <pierrick@megami.fr>
 */

#include "TagByte.h"

/* NAMEDTAG_H_ */
namespace NamedBinaryTag
{
TagByte::TagByte() :
	NamedTag(), value(0)
{
}

TagByte::~TagByte()
{
}

TagTypes TagByte::get_TagType() const
{
	return TAG_BYTE;
}

void TagByte::Write(std::ostream & output, bool ignoreName) const
{
	NamedTag::Write(output, ignoreName);
	output.write((const char*) (((&this->value))), 1);
}

void TagByte::set_Value(int8_t value)
{
	this->value = value;
}

void TagByte::Read(std::istream & input, bool ignoreName)
{
	NamedTag::Read(input, ignoreName);
	input.read((char*) (((&this->value))), 1);
}

int8_t TagByte::get_Value() const
{
	return this->value;
}

ITag *TagByte::clone() const
{
	return this->clone(NULL);
}

ITag *TagByte::clone(void *newRoot) const
{
	TagByte *copy = new TagByte();
	copy->value = this->value;
	return copy;
}

}
